/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ga;

import java.util.ArrayList;
import java.util.Random;

/**
 *
 * @author mbsn
 */
public class Path {

    public Path() {
    }
    private ArrayList<Integer> path = new ArrayList<Integer>();

    public void addVertex(int v) {
        path.add(v);
    }

    public ArrayList<Integer> getPath() {
        return path;
    }

    public int getVertex(int i) {
        if (i > -1 && i < path.size()) {
            return path.get(i);
        }
        return -1;
    }

    @Override
    public String toString() {
        String res = "path: ";
        for (int i = 0; i < path.size(); i++) {
            res = res + (path.get(i)).toString() + " ";
        }
        return res;
    }
}
